package com.itqf.utils;

import java.util.HashMap;

/**
 * @Description:
 * @Company: 千锋互联
 * @Author: 李丽婷
 * @Date: 2020/10/12
 * @Time: 上午11:25
 */
public class R   extends HashMap {
    private  int code;//状态码  失败0  成功 1
    private  String  msg;//信息

    public  R(){}

    public  R(int c){
        this.put("code",c);
    }

    public  R(int code,String msg){
//        this.code = code;
//        this.msg = msg;
        this.put("code",code);
        this.put("msg",msg);
    }

    public  static  R  ok(){

        return  new R(1);
    }
    public  static  R  ok(String  msg){

        return  new R(1,msg);
    }

    public  static  R  error(){

        return  new R(0);
    }
    public  static  R  error(String  msg){

        return  new R(0,msg);
    }




}
